package com.flute.framework.data.mysql;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

import com.flute.framework.data.constants.Constants;

public final class SelectSQL implements Serializable {
	private static final long serialVersionUID = 6336085943351230670L;
	private String selectClause;

	public String getSelect() {
		return selectClause;
	}

	public void setSelect(String select) {
		this.selectClause = select;
	}

	public String toSQL(String table) {
		if (table == null || selectClause == null) {
			throw new NullPointerException();
		}
		return StringUtils.replace(selectClause, Constants.TABLE_NAME, table);
	}
}
